package com.qumap.item.request.load;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.qumap.item.ItemOnMap;
import com.qumap.item.content.ObjectOnMapShort;
import com.qumap.item.request.ItemFilterAndLoadProcessor;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 26.06.11
 * Time: 15:23
 * To change this template use File | Settings | File Templates.
 */
public class LoadItemCallback implements AsyncCallback<ObjectOnMapShort> {

    private ItemFilterAndLoadProcessor processor;
    private ItemOnMap container;

    public LoadItemCallback(ItemFilterAndLoadProcessor processor) {
        this.processor = processor;
    }

    public void setContainerObject(ItemOnMap container) {
        this.container = container;
    }

    @Override
    public void onFailure(Throwable throwable) {
        processor.onFailure(throwable);
    }

    @Override
    public void onSuccess(ObjectOnMapShort objectOnMapShort) {
        processor.onRequestedObjectLoad(container, objectOnMapShort);
    }
}
